{extend name="common:base" /}

{block name="title"}{$data.title} - 天佑二手货{/block}
{block name="page"}goods-detail{/block}

{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/css/lightbox.min.css">
{/block}

{block name="main"}
<div class="am-g am-g-fixed am-margin-top-lg">
<div class="am-u-sm-9">
    <div class="am-g">
        <div class="am-u-sm-6">
            {if condition="!$data.thumb"}
            <img class="am-img-responsive" src="__ROOT__/static/images/no-thumb.png">
            {else /}
            <a title="{$data.title}" href="__ROOT__{$data.thumb}" data-lightbox="group-thumb">
                <img class="am-img-thumbnail" src="__ROOT__{$data.thumb}">
            </a>
            {/if}
        </div>
        <div class="am-u-sm-6 header">
            <h1 class="am-margin-top am-text-truncate" title="{$data.title}">{$data.title}</h1>
            <p class="price">
                <span class="am-text-danger am-text-xl"><i class="am-icon am-icon-xs am-icon-cny"></i>  {$data.price}</span>
                <span class="am-text-danger am-text-lg">{$data.bargain}</span>
            </p>
            <p class="area">交易地点: <span class="am-text-lg">{$data.area}</span></p>
            <p class="area">剩余时间: <span class="am-text-lg">{$data.deadline|get_time_diff}</span></p>
            <a class="am-btn am-btn-secondary" data-am-modal="{target: '#popup-contact'}">联系卖家</a>
        </div>
    </div>
    {if condition="$data.expand.photos_count > 0"}
    <div class="am-g">
        <div class="am-g-sm-12">
            <div class="am-margin-top-lg good-detail">{$data.description}</div>
            <ul class="am-avg-sm-4 am-margin-top-lg">
                {volist name="data.expand.photos" id="vo"}
                <li><a title="{$data.title}" href="__ROOT__{$vo}" data-lightbox="group-{$data.good_id}">
                    <img class="am-img-thumbnail" src="__ROOT__{$vo}"></a></li>
                {/volist}
            </ul>
        </div>
    </div>
    <div class="am-popup" id="popup-contact">
        <div class="am-popup-inner">
            <div class="am-popup-hd">
                <h4 class="am-popup-title">{$data.user_id|get_username} 的联系方式</h4>
                <span class="am-close" data-am-modal-close><i class="am-icon am-icon-sm am-icon-close"></i></span>
            </div>
            <div class="am-popup-bd">
          ...
            </div>
        </div>
    </div>

<!--
TODO: 同店铺推荐
<div class="am-g am-margin-top-xl">
    <hr>
    <h3>该卖家还在卖这些</h3>
</div>
-->

    {/if}
</div>


<div class="am-u-sm-3" style="border-left: 1px solid #999;">
    预留侧边栏
</div>
</div>
{/block}

{block name="js"}
<script src="__STATIC__/js/lightbox.min.js"></script>
{/block}